package com.linx.common.translation.core.impl;

import com.linx.common.core.domain.dto.OssDTO;
import com.linx.common.core.service.OssService;
import com.linx.common.translation.annotation.TranslationType;
import com.linx.common.translation.constant.TransConstant;
import com.linx.common.translation.core.TranslationInterface;
import lombok.AllArgsConstructor;

import java.util.List;

/**
 * OSS翻译实现
 *
 * @author Lion Li
 */
@AllArgsConstructor
@TranslationType(type = TransConstant.BIZ_TO_OSS)
public class OssTranslationImpl implements TranslationInterface<List<OssDTO>> {

    private final OssService ossService;

    @Override
    public List<OssDTO> translation(Object key, Object key2, String other, Class<?> clazz) {
        if (key == null || key.toString().isEmpty()) {
            return null;
        }

        return ossService.selectByBiz(Long.valueOf(key.toString()),other, clazz);
    }

}
